package com.mes.schedule.domain;


import java.io.Serializable;

/**
 * 记录工序任务与设备的对应关系
 * @author Administrator
 * @version 1.0
 * @created 18-锟斤拷锟斤拷-2011 14:55:23
 */
public class ResourceConstraint  implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	protected String taskUid;
	protected String deviceUid;
	protected SDevice device;
	protected Integer priority;
	protected int needCapability;
	
	protected double setupTime;
	protected double runTime;
	protected long costPerUnit;
	protected long costPerUnitOvertime;
	public ResourceConstraint(){


	}
	public ResourceConstraint(String taskUid,String deviceUid){
		this.taskUid=taskUid;
		this.deviceUid=deviceUid;

	}
//	@Override
//	public int hashCode() {
//		final int prime = 31;
//		int result = 1;
//		result = prime * result
//				+ ((deviceUid == null) ? 0 : deviceUid.hashCode());
//		return result;
//	}
//	@Override
//	public boolean equals(Object obj) {
//		if (this == obj)
//			return true;
//		if (obj == null)
//			return false;
//		if (getClass() != obj.getClass())
//			return false;
//		final ResourceConstraint other = (ResourceConstraint) obj;
//		if (deviceUid == null) {
//			if (other.deviceUid != null)
//				return false;
//		} else if (!deviceUid.equals(other.deviceUid))
//			return false;
//		return true;
//	}
	
	/**
	 * @return the deviceUid
	 */
	public String getDeviceUid() {
		return deviceUid;
	}
	/**
	 * @param deviceUid the deviceUid to set
	 */
	public void setDeviceUid(String deviceUid) {
		this.deviceUid = deviceUid;
	}
	

	public Integer getPriority() {
		return priority;
	}
	public void setPriority(Integer priority) {
		this.priority = priority;
	}
	/**
	 * @return the needCapability
	 */
	public int getNeedCapability() {
		return needCapability;
	}
	/**
	 * @param needCapability the needCapability to set
	 */
	public void setNeedCapability(int needCapability) {
		this.needCapability = needCapability;
	}
	/**
	 * @return the setupTime
	 */
	public double getSetupTime() {
		return setupTime;
	}
	/**
	 * @param setupTime the setupTime to set
	 */
	public void setSetupTime(double setupTime) {
		this.setupTime = setupTime;
	}
	/**
	 * @return the runTime
	 */
	public double getRunTime() {
		return runTime;
	}
	/**
	 * @param runTime the runTime to set
	 */
	public void setRunTime(double runTime) {
		this.runTime = runTime;
	}
	/**
	 * @return the costPerUnit
	 */
	public long getCostPerUnit() {
		return costPerUnit;
	}
	/**
	 * @param costPerUnit the costPerUnit to set
	 */
	public void setCostPerUnit(long costPerUnit) {
		this.costPerUnit = costPerUnit;
	}
	/**
	 * @return the costPerUnitOvertime
	 */
	public long getCostPerUnitOvertime() {
		return costPerUnitOvertime;
	}
	/**
	 * @param costPerUnitOvertime the costPerUnitOvertime to set
	 */
	public void setCostPerUnitOvertime(long costPerUnitOvertime) {
		this.costPerUnitOvertime = costPerUnitOvertime;
	}
	/**
	 * @return the device
	 */
	public SDevice getDevice() {
		return device;
	}
	/**
	 * @param device the device to set
	 */
	public void setDevice(SDevice device) {
		this.device = device;
		if(device!=null)this.deviceUid=device.getDeviceUid();
	}

	public String getTaskUid() {
		return taskUid;
	}

	public void setTaskUid(String taskUid) {
		this.taskUid = taskUid;
	}
	

}